<template>
	<view class="ele">
		<view class="warehouse-box mb20">
			<view class="title f32">出入库管理</view>
			<view class="content mt20 disFlex flexWrap" >
				<block v-for="(item, index) in allPermission" :key="index">
					<view class="item_box" v-if="item.selected"  @click="skip(item)">
						<view class="item_top flexJC">
							<image class="item_img" :src="BaseURL+item.menu_picture"></image>
						</view>
						<view class="item_txt f28 tc">{{ item.title }}</view>
					</view>
				</block>
				<!-- 人脸识别 -->
				<view class="item_box"  @click="skip()">
						<view class="item_top flexJC">
							<image class="item_img" :src="BaseURL+'/uploads/xcx/jia_1.png'"></image>
						</view>
						<view class="item_txt f28 tc">{{ '人脸识别' }}</view>
				</view>
				<view class="item_box"  @click="gohome">
						<view class="item_top flexJC">
							<image class="item_img" :src="BaseURL+'/uploads/xcx/jia_1.png'"></image>
						</view>
						<view class="item_txt f28 tc">{{ '测试' }}</view>
				</view>
			</view>
		</view>
		<!-- 问卷管理 -->
		<!-- <view class="questionnaire-box mb20">
			<view class="title f32 flexWrap">问卷管理</view>
			<view class="content disJcsb">
				<view class="item_box" v-for="(item, index) in questionnaireList " :key="index">
					<view class="item_img">
						<image :src="item.img"></image>
					</view>
					<view class="item_txt f28 tc">{{ item.title }}</view>
				</view>
			</view>
		</view> -->
		<!-- 营养膳食管理 -->
		<!-- <view class="food-box">
			<view class="title f32">
				营养膳食管理
			</view>
		</view> -->

	</view>
</template>

<script>
export default {
	data() {
		return {
			warehouseList: [
				{
					title: '采购单申请',
					url: "/pages/procurementPlan/procurementPlan"
				}, {
					title: '采购单管理',
					url: "/pages/purchaseOrder/purchaseOrder"
				}, {
					img: '',
					title: '出库管理', 
				}, {
					img: '',
					title: '库存明细账',
					url: "/pages/inventoryledger/inventoryledger"
				}, {
					img: '',
					title: '库存总账',
					url: "/pages/generaLedger/generaLedger"
				},
			],
			questionnaireList: [
				{
					title: '创建问卷'
				}, {
					title: '问卷列表'
				},
			]
		}
	},
	/*监听页面加载，该钩子被调用时*/ 
	onLoad(options) {

	},
	methods: {
		skip(item) {
			// 现在就是要该路径  
			// 比较麻烦的 就说你需要改成跟后端对应的路径
			if(item){
				uni.setStorageSync("childId",item.id )
				uni.navigateTo({
					url:item.url+"?id="+item.id 
				});
			}else{
				uni.navigateTo({
					url:'../face/face'
				});
			}
		},
		gohome(){
			console.log("gohome");
			uni.navigateTo({
				url: "../debug/dome"
			});
		},
		goProcurementPlan() {
			console.log(this.form, 'form')
			// uni==wx
			uni.switchTab({
				url: "../home/home"
			})
		},
	},
	mounted() {
		
		if(uni.getStorageSync('permission')){
			this.getAllpermission(uni.getStorageSync('permission'))
		}
	},
	/*监听页面显示，页面每次出现在屏幕上都触发*/ 
	onShow() {
		uni.setNavigationBarTitle({
			title: '应用-丰苗智慧后勤'
		});
	},
	/*监听用户下拉动作，一般用于下拉刷新*/ 
	onPullDownRefresh() {

	}

}
</script>


<style lang="scss">
.ele {
	width: 100%;
	min-height: 100vh;
	height: 100%;
	background-color: #F4F4F4;
	padding-bottom: 15rpx;

	// 出入库管理
	.warehouse-box {
		width: 100%;
		padding: 0 20rpx 20rpx 20rpx;
		height: auto;
		border-radius: 8rpx;
		background-color: #FFFFFF;
		box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(0, 0, 0, 0.1);

		.title {
			color: rgba(16, 16, 16, 1);
			font-family: PingFangSC-regular;
			margin-top: 26rpx;
			margin-left: 26rpx;
		}

		.content {
			width: 100%;
			height: auto;

			.item_box {
				padding: 10rpx;
				width:25%;
				box-sizing: border-box;
				margin-top:20rpx;
				.item_top{
				}
				.item_img {
					width: 60rpx;
					height: 60rpx;
					background-size: cover;
					margin: 0 auto;
				}

				.item_txt {
					color: rgba(102, 102, 102, 1);
					font-family: SourceHanSansSC-regular;
					margin-top: 22rpx;
				}
			}

		}

	}

	// 问卷管理
	.questionnaire-box {
		width: 100%;
		padding: 0 20rpx;
		height: 466rpx;
		border-radius: 8rpx;
		background-color: #FFFFFF;
		box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(0, 0, 0, 0.1);
		padding-top: 30rpx;

		.title {
			color: rgba(16, 16, 16, 1);
			font-family: PingFangSC-regular;
			margin-left: 26rpx;
		}

		.content {
			width: 100%;
			height: auto;
			margin-top: 62rpx;

			.item_box {
				padding: 10rpx;

				.item_img {
					width: 60rpx;
					height: 60rpx;
					background: #f34d45;
					background-size: cover;
					margin: 0 auto;
				}

				.item_txt {
					color: rgba(102, 102, 102, 1);
					font-family: SourceHanSansSC-regular;
					margin-top: 22rpx;
				}
			}

		}
	}

	.food-box {
		width: 100%;
		padding: 0 20rpx;
		height: 466rpx;
		border-radius: 8rpx;
		background-color: #FFFFFF;
		box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(0, 0, 0, 0.1);
		padding-top: 30rpx;

		.title {
			color: rgba(16, 16, 16, 1);
			font-family: PingFangSC-regular;
			margin-left: 26rpx;
		}
	}
}</style>
